import * as types from './mutation-type'
import http from '../../utils/http'

export const login = function ({commit}) {
  http.get('/artist/list?cat=1001').then(data=>{
    commit(types.GET_MUSIC_LIST,data.data.artists)
  }).catch(err=>{
    console.log(err)
  })
}

export const personalized_newsong = function ({commit}) {
  http.get('/personalized/newsong').then(data=>{
    commit(types.PERSONALIZED_NEWSONG,data.data.result)
  }).catch(err=>{
    console.log(err)
  })
}

export const hot_music = function ({commit}) {
  http.get('/personalized/newsong').then(data=>{
    commit(types.HOT_MUSIC,data.data.result)
  }).catch(err=>{
    console.log(err)
  })
}